package com.pdool.game.mgr;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.WebSocketSession;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
@Data
public class UserMgr implements InitializingBean {
    private static UserMgr instance;
    private final Map<String, WebSocketSession> sessionMap = new ConcurrentHashMap<>();

    public static UserMgr getInstance() {
        return instance;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        instance = this;
    }

    //-------------------------------------------------------------------


}
